package com.hunttown.mes.common.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @title: 获取资源文件中的某个属性值
 * @author: wangjunfu
 * @date: 2021年05月15日 19:23
 * @description:
 */
public class PropertyUtils {

    private static Properties properties;

    static {
        try {
            properties = new Properties();
            InputStream in = PropertyUtils.class.getResourceAsStream("/important.properties");
            properties.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    //传入key
    public static String getValue(String key) {
        return properties.getProperty(key);
    }
}
